﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace CS322_V4
{
    public partial class FormWithScrollable_Image : Form
    {
        public FormWithScrollable_Image()
        {
            InitializeComponent();
        }

        private void FormWithScrollable_Image_Load(object sender, EventArgs e)
        {
            string text = "Ovo je četvrta vežba iz programskog jezika C#.";
            using (Font font = new Font("Tahoma", 20))
            {
                Bitmap b = new Bitmap(600, 600);
                using (Graphics g = Graphics.FromImage(b))
                {
                    g.FillRectangle(Brushes.White, new Rectangle(0, 0,
                    b.Width, b.Height));
                    // Ispisuje nekoliko linija teksta
                    for (int i = 0; i < 10; i++)
                    {
                        g.DrawString(text, font, Brushes.Black, 50, 50 + i * 60);
                    }
                }
                // Prikazuje bitmap-u u picture box-u.
                pictureBox1.BackgroundImage = b;
                pictureBox1.Size = b.Size;
            }

        }

        private void pictureBox1_Click(object sender, EventArgs e)
        {

        }
    }
}
